#include "precompile.h"

#include "RectEventHandler.h"
#include "command/arg/SplineItemArgument.h"

RectEventHandler::RectEventHandler()
{
}

RectEventHandler::~RectEventHandler()
{
}

Tracker* RectEventHandler::BeginTrack()
{
	return new RectTracker();
}

bool RectEventHandler::EndTrack(SystemEventArgs* /*e*/,const Point& begin,const Point& end)
{
	Point rbegin = interaction->CalcRelativePoint(begin);
	Point rend = interaction->CalcRelativePoint(end);

	SplineItemArgument arg(rbegin,rend,rectangleSplineItemRegion);
	GetApplication()->GetController()->ExecuteCommand(Commands::CreateSplineItem,&arg);
	return true;
}